package com.neusoft.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: duan
 * @Date: Create in 17:03 2020/11/2
 */
@Controller
@RequestMapping("hello")
public class HelloController {
    @RequestMapping("index")
    public String index() {
        System.out.println("hello");
        return "/index.jsp";//相当于forward转发
    }

    @RequestMapping("redirect")
    public String redirect() {
        System.out.println("hello");
//        return "redirect:/WEB-INF/pages/jsp/redirect.jsp";//redirect重定向
        return "redirect:redirect2";
    }

    @RequestMapping("redirect2")
    public String redirect2() {
        return "redirect";
    }

    @RequestMapping("test")
    public String test() {
        System.out.println("test");
        return "jsp/test";//相当于forward转发
    }
}
